<include file="Public:header" />
<style type="text/css">
.dld_top {
    width: 100%;
    height: auto;
    background: #060606;
}

.dld_top_li {
    width: 80%;
    margin: 0 auto;
}

.dld_top_a {
    width: 50%;
    display: block;
    float: left;
    height: auto;
    text-align: center;
}

.dld_top_a img {
    width: auto;
    max-width: 100%;
}

.dld_time {
    width: 100%;
    height: auto;
    padding-top: 2rem;
}

.dld_time_lol {
    background: url(__PUBLIC__/new/images/dld_lol.jpg) no-repeat;
    background-size: cover;
}

.dld_time_dota {
    background: url(__PUBLIC__/new/images/dld_dota.jpg) no-repeat;
    background-size: cover;
}

.dld_time h1 {
    width: 100%;
    height: 3rem;
    line-height: 3rem;
    font-size: 2rem;
    color: #fff;
    font-weight: bold;
    text-align: center;
    letter-spacing: 3px;
    margin-top: 0;
}

.dld_time_box {
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.dld_time_box_num {
    width: 6.5rem;
    height: 8rem;
    background: url(./3.png) no-repeat;
    background-size: cover;
    line-height: 7rem;
    text-align: center;
    margin-right: 0.5rem;
    display: inline-block;
    position: relative;
}

.dld_time_box_num span {
    font-size: 8rem;
    color: #333333;
    font-weight: 600;
}

.dld_time_box_num:nth-child(2) {
    margin-right: 2rem;
}

.dld_time_box_num:nth-child(4) {
    margin-right: 0;
}

.dld_time_box_num_h {
    width: 100%;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
}

.dld_time_box_num_h img {
    width: 100%;
    height: auto;
}

.dld_wyao {
    width: 100%;
    text-align: center;
    padding: 2rem 0;
}

.dld_wyao a {
    padding: 0.5rem 2rem;
    font-size: 2rem;
    color: #fff;
    font-weight: bold;
    background: #19a2f4;
    border-radius: 2rem;
}

.dld_users {
    width: 100%;
    height: 6rem;
    overflow: hidden;
    background: #1d2b32;
}

.dld_user {
    width: 11.5rem;
    height: auto;
    float: left;
    padding: 1rem;
}

.dld_user_header {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    overflow: hidden;
    float: left;
    margin-right: 0.5rem;
}

.dld_user_header img {
    width: 100%;
    height: 100%;
}

.dld_user_text {
    width: 5rem;
    height: 2rem;
    line-height: 2rem;
    font-size: 1rem;
    float: left;
    color: #c4c4c4;
    overflow: hidden;
}

.dld_title {
    width: 100%;
    background: #131c21;
    height: 3rem;
    line-height: 3rem;
}

.dld_title_icon {
    margin-left: 1rem;
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
    background: #1275a6;
    border-radius: 50%;
    display: inline-block;
}

.dld_title_big {
    color: #d3d3d3;
    font-size: 2rem;
    display: inline-block;
}

.dld_title_small {
    display: inline-block;
    float: right;
    text-align: right;
    font-size: 1rem;
}

.dld_title_small .span1 {
    width: 1.2rem;
    height: 1.2rem;
    display: inline-block;
}

.dld_title_small .span1 img {
    width: 100%;
    height: 100%;
    margin-top: -0.4rem;
}

.dld_title_small .span2 {
    color: #1275a6;
}

.dld_title_small .span3 {
    color: #d3d3d3;
}

.dld_title_small .span4 {
    color: #be7900;
}

.dld_title_small .span5 {
    color: #d3d3d3;
}

.dld_title_small .span6 {
    color: #d70000;
    padding-right: 1rem;
}

.dld_jchi {
    width: 100%;
    height: auto;
    background: #1d2b32;
}

.dld_jchi_ul {
    width: 80%;
    margin: 0 auto;
    padding: 1rem 0;
}

.dld_jchi_li {
    width: 25%;
    height: auto;
    padding-bottom: 5px;
    float: left;
}

.dld_jchi_li img {
    width: 95%;
    border: 1px solid #676767;
    height: auto;
}

.dld_jilu {
    width: 100%;
    height: auto;
}

.dld_jilu_li {
    width: 100%;
    height: auto;
    background: #1d2b32;
    padding: 1.5rem 0;
    margin-bottom: 0.8rem;
}

.dld_jilu_li_l {
    width: 20%;
    float: left;
    text-align: right;
}

.dld_jilu_li_l img {
    width: 5rem;
    height: 5rem;
    border-radius: 50%;
    margin-right: 1rem;
}

.dld_jilu_li_r {
    width: 80%;
    float: left;
    text-align: right;
}

.dld_jilu_li_r_t {
    width: 100%;
    height: 2rem;
    text-align: left;
    line-height: 2rem;
    font-size: 1.5rem;
}

.dld_jilu_li_r_t .span1 {
    color: #dbdbdb;
}

.dld_jilu_li_r_t .span2 {
    color: #dbdbdb;
}

.dld_jilu_li_r_t .span3 {
    color: #b41c1c;
}

.dld_jilu_li_r_t .span4 {
    color: #1382b5;
    float: right;
    display: inline-block;
    padding-right: 1rem;
}

.dld_jilu_li_r_x {
    width: 100%;
    height: auto;
}

.dld_jilu_li_r_x span {
    width: 5rem;
    height: auto;
    float: left;
    margin-right: 2px;
    margin-bottom: 2px;
    border: 1px solid #676767;
}

.dld_jilu_li_r_x span img {
    width: 100%;
    height: auto;
}

.img_icon_btn {
    width: 100%;
    background: #19a2f4;
    color: #f3f4f5;
    font-size: 2rem;
    letter-spacing: 1px;
    text-align: center;
    height: 5rem;
    line-height: 5rem;
    border-radius: 0 0 5px 5px;
    overflow: hidden;
}

.img_icon_btn .img_icon_btn3 {
    width: 50%;
    float: left;
    background: #0970ae;
    color: #aeb6ba;
}

.img_icon_btn .img_icon_btn4 {
    width: 50%;
    float: left;
    background: #28373f;
    color: #aeb6ba;
}

.dld_tc_t {
    text-align: center;
    color: #0970ae;
    font-size: 2rem;
    line-height: 7rem;
    font-weight: bold;
}

.dld_tc_list {
    width: 90%;
    margin: 0 auto;
}

.dld_tc_list_li {
    width: 31%;
    margin-right: 2%;
    float: left;
    margin-bottom: 0.5rem;
}

.dld_tc_list_img {
    width: 100%;
    height: auto;
    position: relative;
}

.dld_tc_list_img img {
    width: 100%;
    height: auto;
}

.dld_tc_list_icon {
    position: absolute;
    right: -0.4rem;
    bottom: -0.3rem;
    z-index: 2;
    width: 1.4rem;
    height: 1.4rem;
    display: none;
}

.dld_tc_list_icon img {
    width: 100%;
    height: 100%;
}

.dld_tc_list_text {
    font-size: 1.5rem;
    color: #dcdcdc;
    line-height: 2rem;
    text-align: center;
}

.dld_tc_d {
    text-align: center;
    color: #0970ae;
    font-size: 2rem;
    line-height: 2.5rem;
    padding: 1rem 0;
}

.dld_tc_d span {
    color: #0970ae;
}

.selectedb {
    position: absolute;
    left: -6.5%;
    top: -2.5%;
    width: 112%;
    height: auto;
}

.selectedb img {
    width: 100%;
    height: 100%;
}

.evdlduser {
    box-sizing: border-box;
    float: left;
    position: relative;
    width: 20%;
    height: 100%;
    padding: 10px;
}

.evdlduser img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}


/*设置时间盒子旋转*/

.dld_time_box_num {
    transform-style: preserve-3d;
}

.cartoon {
    animation: animations 1s ease-out infinite;
}

@-webkit-keyframes animations {
    0% {
        -webkit-transform: rotateX(0) rotateY(0);
    }
    100% {
        -webkit-transform: rotateX(360deg) rotateY(0);
    }
}
</style>
<!--主体-->
<div class="wrap">
    <div class="dld_top">
        <div class="dld_top_li">
            <a href="javascript:;" class="dld_top_a">
                <img src="__PUBLIC__/new/images/yxc.jpg">
            </a>
            <a href="javascript:;" class="dld_top_a">
                <img src="__PUBLIC__/new/images/dld_c.jpg">
            </a>
            <div class="clear"></div>
        </div>
    </div>
    <div class="dld_time dld_time_lol">
        <h1>倒计时</h1>
        <div class="dld_time_box">
            <div class="dld_time_box_num minutes1">
                <span class="fen1">0</span>
                <div class="dld_time_box_num_h">
                    <img src="__PUBLIC__/new/images/dld_time2.png">
                </div>
            </div>
            <div class="dld_time_box_num minutes2">
                <span class="fen2">1</span>
                <div class="dld_time_box_num_h">
                    <img src="__PUBLIC__/new/images/dld_time2.png">
                </div>
            </div>
            <div class="dld_time_box_num seconds1">
                <span class="miao1">0</span>
                <div class="dld_time_box_num_h">
                    <img src="__PUBLIC__/new/images/dld_time2.png">
                </div>
            </div>
            <div class="dld_time_box_num seconds2">
                <span class="miao2">0</span>
                <div class="dld_time_box_num_h">
                    <img src="__PUBLIC__/new/images/dld_time2.png">
                </div>
            </div>
            <div class="clear"></div>
        </div>
        <div class="dld_wyao">
            <a href="javascript:;" onclick="show_dld_tz()">我要乱斗</a>
        </div>
    </div>
    <div class="dld_users">
        <volist name="nowdld_users" id="u">
            <div class="evdlduser dld_user_id{$u.userId}" data-uid="{$u.userId}">
                <img src="{$u.header}"> Material Theme </div>
        </volist>
        <div class="clear"></div>
    </div>
    <div class="dld_title">
        <div class="dld_title_icon"></div>
        <div class="dld_title_big">
            决斗场
        </div>
        <div class="dld_title_small">
            <span class="span1">
				<img src="__PUBLIC__/new/images/ren.png">
			</span>
            <span class="span2">{$nowdld.rennum}</span>
            <span class="span3">部队数：</span>
            <span class="span4">{$nowdld.bnum}</span>
            <span class="span5">战斗力总值：</span>
            <span class="span6">{$nowdld.zjine}</span>
        </div>
    </div>
    <div class="dld_jchi">
        <div class="dld_jchi_ul">
            <volist name="nowdld_users" id="u">
                <volist name="u.dldimgs" id="i">
                    <div class="dld_jchi_li">
                        <img src="{$i.img}">
                    </div>
                </volist>
            </volist>
            <div class="clear"></div>
        </div>
    </div>
    <div class="dld_title">
        <div class="dld_title_icon"></div>
        <div class="dld_title_big">
            历史中奖记录
        </div>
    </div>
    <div class="dld_jilu">
        <volist name="old_dld" id="o">
            <div class="dld_jilu_li">
                <div class="dld_jilu_li_l">
                    <img src="{$o.users.header}">
                </div>
                <div class="dld_jilu_li_r">
                    <div class="dld_jilu_li_r_t">
                        <span class="span1">{$o.users.name}</span>
                        <span class="span2">
						以<span class="span3">{$o.gailv}%</span>的概率赢得了<span class="span3">{$o.yjine}</span>金币
                        </span>
                        <span class="span4">{$o.qi}期</span>
                    </div>
                    <div class="dld_jilu_li_r_x">
                        <volist name="o.jilu_img" id="j">
                            <span>
								<img src="{$j.img}" >
							</span>
                        </volist>
                        <div class="clear"></div>
                    </div>
                </div>
                <div class="clear"></div>
            </div>
        </volist>
    </div>
    <div class="cp_more">
        <input type="hidden" value="1" id="nowpage" />
        <a href="javascript:;" class="more_btn">点击查看更多</a>
    </div>
    <script type="text/javascript">
    // 点击查看更多按钮
    $(".more_btn").click(function() {
        var nowpage = $("#nowpage").val();
        //采用post方式调用服务
        $.post("{:U('Index/more_dld_jilu')}", {
            nowpage: nowpage
        }, function(v) {
            $(".dld_jilu").append(v.ccc);
            $("#nowpage").val(v.nextpage);
        }, 'JSON');
    })
    </script>
</div>
<!--弹窗 start-->
<div class="tc_box_bg" id="dld_tz">
    <div class="tc_box" style="margin-top:0;top:0;max-height:98%;overflow:auto;">
        <div class="dld_tc_t">
            选择你要投入的战斗力
        </div>
        <div class="dld_tc_list">
            <volist name="dld_b" id="b">
                <div class="dld_tc_list_li" data-id="{$b.id}" data-jb="{$b.jine}">
                    <div class="dld_tc_list_img">
                        <img src="{$b.img}">
                        <div class="dld_tc_list_icon">
                            <img src="__PUBLIC__/new/images/icon_check.png">
                        </div>
                    </div>
                    <div class="dld_tc_list_text">
                        {$b.name}
                        <br> （{$b.jine}金币）
                    </div>
                </div>
            </volist>
            <div class="clear"></div>
        </div>
        <div class="dld_tc_d">
            参与<span class="zb">0</span>件装备，共计<span class="jb">0</span>金币，预计中奖概率<span class="gl">0</span>
        </div>
        <div class="img_icon_btn">
            <input type="hidden" style="color:#000;" id="tz_b_ids" value="">
            <a href="javascript:;" class="img_icon_btn3" onclick="to_dld_tz()">确认投注</a>
            <a href="javascript:;" onclick="hide_dld_tz()" class="img_icon_btn4">取消</a>
            <div class="clear"></div>
        </div>
    </div>
</div>
<!--弹窗 end-->
<script type="text/javascript">
var updatea;
var stopzero = true;
//大乱斗投注函数
function to_dld_tz() {
    var zb_obj = $(".dld_tc_d").find(".zb");
    // 得到参与装备数
    var zb_num = zb_obj.text();
    var jb_obj = $(".dld_tc_d").find(".jb");
    //得到参与金币数
    var jb_num = jb_obj.text();
    var tz_b_ids = $("#tz_b_ids").val();
    // 得到参与部队数
    var yi_b_num = $(".dld_title_small").find(".span4").text();
    var zong_b_num = Number(zb_num) + Number(yi_b_num);
    if (zong_b_num > 10) {
        alert("装备总数最多10个");
        return false;
    }
    if (zb_num <= 0) {
        alert("装备数最少一个");
        return false;
    }
    if (zb_num > 3) {
        alert("装备数最多三个");
        return false;
    }
    if (jb_num <= 0) {
        alert("装备数最少一个");
        return false;
    }
    $.post("{:U('Index/dld_tz')}", {
        tz_b_ids: tz_b_ids
    }, function(v) {
        if (v.jieguo == "cg") {
            $(".header").find("span.header-r").html("余额：" + v.user_yue + "");
            $(".nowmoney").html("<label>当前余额 ：</label>" + v.user_yue + "金币");
            $("#tz_b_ids").val("");
            // 将选中图片放入到奖池中
            $(".dld_jchi_ul").prepend(v.tz_imgs);
            //获取到当前用户的id
            var dld_user_id = $(".dld_users").find(".dld_user_id" + v.uid).attr("data-uid");
            // 如果参与大乱斗中的用户id有等于当前id的，则对其装备数进行叠加
            if (dld_user_id == v.uid) {
                var dld_user_id_jine_obj = $(".dld_users").find(".dld_user_id" + v.uid).find(".dld_user_jine");
                var new_dld_user_id_jine = Number(dld_user_id_jine_obj.text()) + Number(v.tz_jine);
                dld_user_id_jine_obj.text(new_dld_user_id_jine);
            } else {
            	// 否则添加用户
                $(".dld_users").prepend("<div class='dld_user dld_user_id" + v.uid + "' data-uid='" + v.uid + "'><div class='dld_user_header'><img src='" + v.user_header + "'></div><div class='dld_user_text'>" + v.user_name + "</div><div class='dld_user_text dld_user_jine'>" + v.tz_jine + "</div><div class='clear'></div></div>");
            }
            //if(v.shengyumiao>=0){
            //	intDiff=v.shengyumiao;
            //	if(intDiff==0){
            //		dld_kj();
            //	}else if(intDiff>0){
            //		timer(intDiff);
            //	}
            //}
            // 更新人数,部队数，战斗力总值
            $(".dld_title_small").find(".span2").text(v.rennum);
            $(".dld_title_small").find(".span4").text(v.bnum);
            $(".dld_title_small").find(".span6").text(v.zjine);
            // 隐藏投注页面以及选中图标
            hide_dld_tz();
            $(".dld_tc_list_icon").hide();
            //将参与装备数，金币数，概率置0
            var zb_obj = $(".dld_tc_d").find(".zb");
            var jb_obj = $(".dld_tc_d").find(".jb");
            var gl_obj = $(".dld_tc_d").find(".gl");
            zb_obj.text(0);
            jb_obj.text(0);
            gl_obj.text(0);
            // 投注id置为空
            $("#tz_b_ids").val("");


        } else if (v.jieguo == "yuebuzu") {
            var jinbi_cha = v.tz_jine - v.user_yue;
            show_yuebz_box(jinbi_cha);
        } else if (v.jieguo == "sb") {
            alert("投注失败");
        } else if (v.jieguo == "zb11") {
            alert("总装备数不能大于10");
        } else if (v.jieguo == "zb1") {
            alert("装备数最少一个");
        } else if (v.jieguo == "zb3") {
            alert("装备数最多三个");
        }
        if (v.shifounew == 1) {
            window.location.reload();
        }
        //$(this).addClass("hint-in1");

    }, 'JSON');
}

function show_dld_tz() {
    $("#dld_tz").show();
}

function hide_dld_tz() {
    $("#dld_tz").hide();
}
$(function() {
    var x = true;
    // 为兵种模块设置点击事件
    $(".dld_tc_list_li").click(function() {
        var icon_obj = $(this).find(".dld_tc_list_icon");
        var icon_zt = icon_obj.css("display");
        // 获取装备数，金币数，概率数
        var zb_obj = $(".dld_tc_d").find(".zb");
        var zb_num = zb_obj.text();
        var jb_obj = $(".dld_tc_d").find(".jb");
        var jb_num = jb_obj.text();
        var gl_obj = $(".dld_tc_d").find(".gl");
        var gl_num = gl_obj.text();
        // 获取到当前模块所代表的金币
        var b_jb = $(this).attr("data-jb");
        var b_id = $(this).attr("data-id");
        var zjine = $(".dld_title_small").find(".span6").text();
        var tz_b_ids_obj = $("#tz_b_ids");
        var tz_b_ids_val = tz_b_ids_obj.val();
        var tz_b_ids_arr = tz_b_ids_val.split(",");

        if (icon_zt == "none") {
            var yi_b_num = $(".dld_title_small").find(".span4").text();
            var zong_b_num = Number(zb_num) + Number(yi_b_num);
            if (zong_b_num > 10) {
                alert("装备总数最多10个");
                return false;
            }
            if (zb_num >= 3) {
                alert("装备最多只能选3件");
            } else {
                icon_obj.show();
                var zb_newnum = Number(zb_num) + 1;
                zb_obj.text(zb_newnum);
                var jb_newnum = Number(jb_num) + Number(b_jb);
                jb_obj.text(jb_newnum);
                var gl_newnum = Math.floor((jb_newnum / (Number(zjine) + Number(jb_newnum))) * 100 * 100) / 100 + "%";
                gl_obj.text(gl_newnum);
                tz_b_ids_arr.push(b_id);
                if ($.inArray("", tz_b_ids_arr) >= 0) {
                    tz_b_ids_arr.splice($.inArray("", tz_b_ids_arr), 1);
                }
                var newtz_b_ids_val = tz_b_ids_arr.join(",");
                tz_b_ids_obj.val(newtz_b_ids_val);
            }

        } else {
            icon_obj.hide();
            var zb_newnum = Number(zb_num) - 1;
            zb_obj.text(zb_newnum);
            var jb_newnum = Number(jb_num) - Number(b_jb);
            jb_obj.text(jb_newnum);
            var gl_newnum = Math.floor((jb_newnum / (Number(zjine) + Number(jb_newnum))) * 100 * 100) / 100 + "%";
            gl_obj.text(gl_newnum);

            tz_b_ids_arr.splice($.inArray(b_id, tz_b_ids_arr), 1);
            var newtz_b_ids_val = tz_b_ids_arr.join(",");
            tz_b_ids_obj.val(newtz_b_ids_val);
        }

    });
});
// 开奖函数
function dld_kj() {
    $.post("{:U('Index/ajax_dld_kj')}", {}, function(v) {
        //if(v.nonew==1){
        //window.location.reload();
        //location.href="/index.php?a=dld&m=index";
        //}else{
        $("#begindjs").val(0);
        $('.fen1').text(0);
        $('.fen2').text(1);
        $('.miao1').text(0);
        $('.miao2').text(0);
        $(".dld_time_box_num").find("span").css("color", "#333333");
        //intDiff=-1;
        //timer(intDiff);
        clearInterval(timerxh);
        timerxh = null;
        $(".dld_jilu").prepend(v.kj_html);
        // alert(v.uid);
        $("#begindjs").val(0);
        $(".selectedb").remove();
        $(".dld_user_id" + v.uid).prepend('<div class="selectedb"><img src="./Public/Mobile/new/images/dld/sec1.png"></div>')
            // clearInterval(updatea); 
            // alert("开奖时间到");      
            // settimeout(function(){
            //     x=true;
            // },10000);
            //}

    }, 'JSON');

}
//获取最新奖池图片
function get_dld_jc() {
    updatea = window.setInterval(function() {
        var now_jc_num = $("div.dld_jchi_ul").find("div.dld_jchi_li").length;
        var nowdldqi = $(".dld_jilu .dld_jilu_li").first().find(".dld_jilu_li_r_t").find(".span4").text();
        nowdldqi = nowdldqi.substring(0, nowdldqi.length - 1);
        $.post("{:U('Index/get_dld_jc')}", {
            now_jc_num: now_jc_num,
            nowdldqi: nowdldqi
        }, function(v) {
            $(".dld_jchi_ul").html(v.moreimg);
            $(".dld_title_small").find(".span2").text(v.rennum);
            $(".dld_title_small").find(".span4").text(v.bnum);
            $(".dld_title_small").find(".span6").text(v.zjine);
            $(".dld_users").html(v.moreuser);
            if (v.shengyumiao >= 0) {
                var begindjs = $("#begindjs").val();
                if (begindjs <= 0) {
                    intDiff = v.shengyumiao;
                    timer(intDiff);
                    $("#begindjs").val(1);
                }
            }
            if (v.more_dld_jilus != undefined) {
                $(".dld_jilu").prepend(v.more_dld_jilus);
                //$("input#nowdldqi").val(v.nowdldqi);
                //alert(v.qi1);
                //alert(v.more_dld_jilus);
            }
        }, 'JSON');
    }, 2000);
}
$(function() {
    get_dld_jc();
});
</script>
<script type="text/javascript">
var timerxh = null;
var intDiff = parseInt({
    $nowdld.shengyumiao
}); //倒计时总秒数量
// 每进行一秒进行的动作
function timer(intDiff) {
	// 一秒间隔
    timerxh = window.setInterval(function() {
    	// 当剩余秒数小于0时，取消选中框的随机选择
        if (intDiff <= 0) {
            // settimeout(function(){
            //                    $('.fen1').text(0);
            //        $('.fen2').text(1);
            //        $('.miao1').text(0);
            //        $('.miao2').text(0);
            //        $(".dld_time_box_num").find("span").css("color","#333333");
            //                 },5000);
            //延迟5秒更改时间，即开奖时间
            clearInterval(updatea);
            clearInterval(timerxh);
        }
        var hour = 0,
            minute = 0,
            second = 0; //时间默认值
        var miao1 = 0;
        var miao2 = 0;
        if (intDiff > 0) {
            hour = Math.floor(intDiff / (60 * 60));
            minute = Math.floor(intDiff / 60) - (hour * 60);
            second = Math.floor(intDiff) - (hour * 60 * 60) - (minute * 60);
        }
        if (minute <= 9) minute = minute;
        if (second <= 9) {
            miao1 = 0;
            miao2 = second;
        } else {
            miao1 = Math.floor(second / 10);
            miao2 = Math.floor(second % 10);
        }
        if (minute > 0) {
            $('.fen1').text(0);

            $('.fen2').text(minute);
            $('.miao1').text(miao1);
            $('.miao2').text(miao2);
        } else {
            $('.fen1').text(0);
            $('.fen2').text(0);
            // $('.seconds2').removeClass('cartoon');
            $('.seconds2').addClass('cartoon');
            $('.miao1').text(miao1);
            $('.miao2').text(miao2);
        }
        if (intDiff <= 10 && intDiff > 0) {
            $(".dld_time_box_num").find("span").css("color", "#b41c1c");
        }
        if (intDiff <= 59 && intDiff > 0) {
            var ranselec = setInterval(function() {
                var i = 2;
                $(".selectedb").remove();
                var randomnum = Math.floor(Math.random() * i);
                console.log(randomnum);
                $(".dld_users div:eq(" + randomnum + ")").prepend('<div class="selectedb"><img src="./Public/Mobile/new/images/dld/sec1.png"></div>')
                if (intDiff <= 1) {
                    clearInterval(ranselec);
                }
            }, 500);
        }
        // 当到达1秒时停止随机选择
        intDiff--;
    }, 1000);
}
$(function() {
    if (intDiff == 0) {
        // function resett(){
        // $('.fen1').text(0);
        // $('.fen2').text(1);
        // $('.miao1').text(0);
        // $('.miao2').text(0);
        // $(".dld_time_box_num").find("span").css("color","#333333");
        // }
        settimeout(resett(), 5000);
        dld_kj();
    } else if (intDiff > 0) {
        timer(intDiff);
    }
});
</script>
<input type="hidden" id="begindjs" value="0">
<input type="hidden" id="nowdldqi" value="{$nowdld.qi}">
<include file="Public:footer" />
